.class public Lrexsee/core/alarm/RexseeWakeLock;
.super Ljava/lang/Object;
.source "RexseeWakeLock.java"

# interfaces
.implements Lrexsee/core/browser/clazz/JavascriptInterface;


# static fields
.field private static final INTERFACE_NAME:Ljava/lang/String; = "WakeLock"


# instance fields
.field private final mBrowser:Lrexsee/core/browser/Browser;

.field private final mContext:Landroid/content/Context;

.field private mWakeLock:Landroid/os/PowerManager$WakeLock;


# direct methods
.method public constructor <init>(Landroid/content/Context;)V
    .locals 1
    .param p1, "context"    # Landroid/content/Context;

    .prologue
    const/4 v0, 0x0

    .line 32
    invoke-direct {p0}, Ljava/lang/Object;-><init>()V

    .line 26
    iput-object v0, p0, Lrexsee/core/alarm/RexseeWakeLock;->mWakeLock:Landroid/os/PowerManager$WakeLock;

    .line 33
    iput-object v0, p0, Lrexsee/core/alarm/RexseeWakeLock;->mBrowser:Lrexsee/core/browser/Browser;

    .line 34
    iput-object p1, p0, Lrexsee/core/alarm/RexseeWakeLock;->mContext:Landroid/content/Context;

    .line 35
    return-void
.end method

.method public constructor <init>(Lrexsee/core/browser/Browser;)V
    .locals 1
    .param p1, "browser"    # Lrexsee/core/browser/Browser;

    .prologue
    .line 28
    invoke-direct {p0}, Ljava/lang/Object;-><init>()V

    .line 26
    const/4 v0, 0x0

    iput-object v0, p0, Lrexsee/core/alarm/RexseeWakeLock;->mWakeLock:Landroid/os/PowerManager$WakeLock;

    .line 29
    iput-object p1, p0, Lrexsee/core/alarm/RexseeWakeLock;->mBrowser:Lrexsee/core/browser/Browser;

    .line 30
    invoke-virtual {p1}, Lrexsee/core/browser/Browser;->getContext()Landroid/content/Context;

    move-result-object v0

    iput-object v0, p0, Lrexsee/core/alarm/RexseeWakeLock;->mContext:Landroid/content/Context;

    .line 31
    return-void
.end method


# virtual methods
.method public acquire(Z)V
    .locals 4
    .param p1, "onAfterRelease"    # Z

    .prologue
    .line 39
    invoke-virtual {p0}, Lrexsee/core/alarm/RexseeWakeLock;->release()V

    .line 40
    iget-object v2, p0, Lrexsee/core/alarm/RexseeWakeLock;->mContext:Landroid/content/Context;

    const-string v3, "power"

    invoke-virtual {v2, v3}, Landroid/content/Context;->getSystemService(Ljava/lang/String;)Ljava/lang/Object;

    move-result-object v1

    check-cast v1, Landroid/os/PowerManager;

    .line 41
    .local v1, "pm":Landroid/os/PowerManager;
    const v0, 0x1000001a

    .line 42
    .local v0, "mode":I
    if-eqz p1, :cond_0

    .line 43
    const/high16 v2, 0x20000000

    or-int/2addr v0, v2

    .line 45
    :cond_0
    const-string v2, ""

    invoke-virtual {v1, v0, v2}, Landroid/os/PowerManager;->newWakeLock(ILjava/lang/String;)Landroid/os/PowerManager$WakeLock;

    move-result-object v2

    iput-object v2, p0, Lrexsee/core/alarm/RexseeWakeLock;->mWakeLock:Landroid/os/PowerManager$WakeLock;

    .line 46
    iget-object v2, p0, Lrexsee/core/alarm/RexseeWakeLock;->mWakeLock:Landroid/os/PowerManager$WakeLock;

    invoke-virtual {v2}, Landroid/os/PowerManager$WakeLock;->acquire()V

    .line 47
    return-void
.end method

.method public getInheritInterface(Lrexsee/core/browser/Browser;)Lrexsee/core/browser/clazz/JavascriptInterface;
    .locals 0
    .param p1, "childBrowser"    # Lrexsee/core/browser/Browser;

    .prologue
    .line 17
    return-object p0
.end method

.method public getInterfaceName()Ljava/lang/String;
    .locals 2

    .prologue
    .line 13
    new-instance v0, Ljava/lang/StringBuilder;

    iget-object v1, p0, Lrexsee/core/alarm/RexseeWakeLock;->mBrowser:Lrexsee/core/browser/Browser;

    iget-object v1, v1, Lrexsee/core/browser/Browser;->application:Lrexsee/core/application/RexseeApplication;

    iget-object v1, v1, Lrexsee/core/application/RexseeApplication;->resources:Lrexsee/core/application/Resource;

    iget-object v1, v1, Lrexsee/core/application/Resource;->prefix:Ljava/lang/String;

    invoke-static {v1}, Ljava/lang/String;->valueOf(Ljava/lang/Object;)Ljava/lang/String;

    move-result-object v1

    invoke-direct {v0, v1}, Ljava/lang/StringBuilder;-><init>(Ljava/lang/String;)V

    const-string v1, "WakeLock"

    invoke-virtual {v0, v1}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

    move-result-object v0

    invoke-virtual {v0}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String;

    move-result-object v0

    return-object v0
.end method

.method public getNewInterface(Lrexsee/core/browser/Browser;)Lrexsee/core/browser/clazz/JavascriptInterface;
    .locals 1
    .param p1, "childBrowser"    # Lrexsee/core/browser/Browser;

    .prologue
    .line 21
    new-instance v0, Lrexsee/core/alarm/RexseeWakeLock;

    invoke-direct {v0, p1}, Lrexsee/core/alarm/RexseeWakeLock;-><init>(Lrexsee/core/browser/Browser;)V

    return-object v0
.end method

.method public release()V
    .locals 1

    .prologue
    .line 49
    iget-object v0, p0, Lrexsee/core/alarm/RexseeWakeLock;->mWakeLock:Landroid/os/PowerManager$WakeLock;

    if-eqz v0, :cond_0

    .line 50
    iget-object v0, p0, Lrexsee/core/alarm/RexseeWakeLock;->mWakeLock:Landroid/os/PowerManager$WakeLock;

    invoke-virtual {v0}, Landroid/os/PowerManager$WakeLock;->release()V

    .line 51
    const/4 v0, 0x0

    iput-object v0, p0, Lrexsee/core/alarm/RexseeWakeLock;->mWakeLock:Landroid/os/PowerManager$WakeLock;

    .line 53
    :cond_0
    return-void
.end method
